<?php

namespace app\admin\controller;

use think\Controller;

class Number extends Controller
{
    //
    public function edit(){
        if(request()->isAjax()){
            $data = input('post.');
            $res = model('number')->save($data,['id'=>1]);
            if($res){
                $this->success("更新成功",$_SERVER['HTTP_REFERER']);
            }else{
                $this->error('更新失败');
            }
        }
        $numberInfo = model('number')->find(1);
        $viewData = [
            'number' => $numberInfo
        ];
        $this->assign($viewData);
        return view();
    }
}
